home *** CD-ROM | disk | FTP | other *** search
- /**
- GRAB Graph Layout and Browser System
-
- Copyright (c) 1989, Tera Computer Company
- **/
-
- /**
- the top-level routine for the InterViews/C++ stuff. First call
- ginit. Then grun. Then it never comes back.
- **/
-
- #include "gframe.h"
- #include "graph.h"
- #include "gview.h"
- #include "tview.h"
- #include "aview.h"
- #include <InterViews/sensor.h>
- #include <InterViews/world.h>
- #include <InterViews/graphic.h>
- #include <InterViews/brush.h>
- #include <InterViews/Graphic/persistent.h>
- #include <InterViews/Graphic/lines.h>
- #include <InterViews/Graphic/ellipses.h>
- #include <InterViews/Graphic/polygons.h>
-
- static Graph* MakeInitialGraph();
- static GView* MakeInitialGView();
- static TextView* MakeInitialTView();
-
- GraphFrame *g;
- Graph *gr;
- GView *gv;
- AView *av;
- World* world;
-
- extern "C" void ginit (int argc, char* argv[])
- {
- world = new World("graph", argc, argv);
- InitPPaint();
- gv = MakeInitialGView();
- g = new GraphFrame(gv, MakeInitialTView()); /* xgrab window */
- av = new AView(g, g->GetNoframe()); /* graph attributes window */
- world->Insert(g);
- }
-
- extern "C" void grun ()
- {
- g->drawside(); /* draw the side window. Otherwise, it never gets done */
- world->Run();
- }
-
- static Graph* MakeInitialGraph ()
- {
- Graph* s;
- s = new Graph();
- return s;
- }
-
- static GView* MakeInitialGView ()
- {
- gr = MakeInitialGraph();
- return new GView(gr);
- }
-
- static TextView* MakeInitialTView ()
- {
- return new TextView("\0", "\0");
- }
-